﻿#ifndef JMYEXCEL_H
#define JMYEXCEL_H

#include "jmyoffice_global.h"
#include <QObject>

// - class JMyExcel -

class JMyExcelPrivate;
class JTableView;
class QTabWidget;
struct JFileNameInfo;

class JMYOFFICE_EXPORT JMyExcel : public QObject
{
    Q_OBJECT
public:

    bool create();
    bool saveAs(const QString &filePath);
    bool close();
    bool show(bool enabled = true);

    bool setTitle(const JFileNameInfo &fileNameInfo, int columnCount);
    bool setSheetTitle(int index, const QString &text, int columnCount);
    bool setSiftArea(const JTableView *tableView);
    bool setSiftRestrain(const JTableView *tableView);
    bool setRecordData(const QTabWidget *tabWidget);

    bool saveBaseLineToSql(const QString &filePath);
    bool readBaseLine(const QString &filePath, QList<QVector<QPointF> > &groupsData);
    bool readBaseLine(QList<QVector<QPointF> > &groupsData);

Q_SIGNALS:

public Q_SLOTS:

private:
    explicit JMyExcel(QObject *parent = 0);
    ~JMyExcel();

private:
    Q_DISABLE_COPY(JMyExcel)
    J_DECLARE_PRIVATE(JMyExcel)
    J_DECLARE_SINGLE_INSTANCE(JMyExcel)
};

#endif  // JMYEXCEL_H
